#ifndef TEXT_H
#define TEXT_H

#include <conio.h>
#include "Entity.h"
#include "Texture.h"
#include "Animation.h"

class Text : public Entity
{
	private:
						///Text Animation
		AnimationBase textAnimation;
						///
		bool Animate;
						///Text String
		std::string text;
						///Direct3D Device needed for rendering.
		LPDIRECT3DDEVICE9   d3ddev;
						///X and Y Position of Text
		float X, Y;
						///Directx font
		LPD3DXFONT pFont;
						///Directx Rect to crate a rectangle to place the text onto
		RECT	   rect;
						///The size of the text.
		int pointSize;
						///Color red, green, blue, alpha range from [0,1]
		float r, g, b, a;
						///update Text Settings.
		void update();
						///Does a ftoa()
		std::string convertDouble(double value);

	public:
									///Constructor
		Text(std::string text="Text"); 
									///Deestructor
		~Text();
									///Initialize the Text
		void init(LPDIRECT3DDEVICE9   d3ddev);
									///FPSRate
		void FpsRate(int rate=5);
									///UseAnimation
		void UseAnimation(bool b);
									///Update Animation
		void updateAnimation(float dt);
									///Set Text Color
		void SetColor(float r, float g, float b);
		void SetColor(float r, float g, float b, float a);
									///Change text size
		void setPointSize(int size=20);
									///Set text string
		void setText(std::string text="Text");
		void setText(double number=0);
		void setText(int number=0);
									///Append text string
		void addText(std::string text="Text");
		void addText(double number=0);
		void addText(int number=0);
									///Set Position (According to window coordinates)
		void setPosition(float x=0.0f, float y=0.0f);
									///Set Position (According to window coordinates)
		void setPosition(Entity * object);
									///Render Text
		void Render(LPDIRECT3DDEVICE9 d3ddev);
};

#endif